let divv = document.querySelector('.zjm')

const xhr1 = new  XMLHttpRequest()
xhr1.open("get","http://chst.vip:1234/api/getcoupon")
xhr1.onload = function(){
    if(xhr1.status === 200){
        let res1 = JSON.parse(xhr1.responseText)
        // console.log(res1);
        let res11 = res1.result
        console.log(res11);
        let lis = ''

       res11.forEach(item => {
        lis +=
        `<div>
        <a href="./page5-1.html?couponid=${item.couponId}">
        <img src="${item.couponImg}" alt="">
        <p>${item.couponTitle}</p>
        </a>
        </div>
        `
        
       })
       divv.innerHTML = lis
    }
}
xhr1.send(null)